﻿using UnityEngine;
using System.Collections;
using System.IO;
using  System.Xml;
//using  System;
//using System.Data;

public class Excel2XML : MonoBehaviour
{

    // Use this for initialization
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {

    }

   /* XmlDocument e2x(string excelFilePath)
    {

        XmlDocument excelData = new XmlDocument();
        System.Data.DataSet excelTableDataSet = new System.Data.DataSet();
        StreamReader excelContent = new StreamReader(excelFilePath, System.Text.Encoding.Default);
        string stringConnectToExcelFile =
            string.Format("provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + excelFilePath + ";Extended Properties=" +
                          "Excel 12.0;");
        System.Data.OleDb.OleDbConnection oleConnectionToExcelFile =
            new System.Data.OleDb.OleDbConnection(stringConnectToExcelFile);
        System.Data.OleDb.OleDbDataAdapter oleDataAdapterForGetExcelTable =
            new System.Data.OleDb.OleDbDataAdapter(string.Format("select * from [Sheet 1$]"), oleConnectionToExcelFile);
        try
        {
            oleDataAdapterForGetExcelTable.Fill(excelTableDataSet);
        }
        catch
        {
            return null;
        }
        string excelOutputXml = Path.GetTempFileName();
        excelTableDataSet.WriteXml(excelOutputXml);
        excelData.Load(excelOutputXml);
        File.Delete(excelOutputXml);
        return excelData;
    }*/
}
